package fifteen;

import java.io.Serializable;
import java.util.Arrays;

public class Student implements Serializable { // serialize 序列化
    private String name;
    private int age;
    private String gender;
    private transient String[] otherInfo; // transient 短暂的

    public Student(){
    }
    public Student(String name, int age, String gender, String[] otherInfo){
        this.age = age;
        this.gender = gender;
        this.name = name;
        this.otherInfo = otherInfo;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public int getAge(){
        return age;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
    public String getGender(){
        return gender;
    }

    public void setName(String name) {
        this.name = name;
    }
    public String getName(){
        return name;
    }

    public void setOtherInfo(String[] otherInfo) {
        this.otherInfo = otherInfo;
    }
    public String[] getOtherInfo(){
        return otherInfo;
    }
    @Override
    public String toString(){
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", otherInfo=" + Arrays.toString(otherInfo) +
                '}';
    }
}
